<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?php echo $headConf['title']?></title>
    <link rel="icon" type="text/css" href="../../../Public/Home/icon.ico" />
    <?php foreach($headConf['css'] as $k=>$v){ ?>
    <link rel="stylesheet" type="text/css" href="/c73/php_beijing/mall/Public/Home/css/<?php echo ($v); ?>.css" />
    <?php } ?>
    <!--用js变量存储购物车异步请求地址-->
    <script>
//        ajax异步请求更新购物车,声明变量以便在js文件中使用
        var ajaxUpdateCart = "<?php echo u('cart/ajaxUpdateCart');?>";
//        ajax异步请求删除购物车中的一条数据，声明变量以便在js文件中使用
        var ajaxDelCartGoods = "<?php echo u('cart/ajaxDelCartGoods');?>";
//        ajax异步请求修改默认地址，声明变量以便在js文件中使用
        var ajaxUpdateSelectedAd = "<?php echo u('order/ajaxUpdateSelectedAd');?>";
//        ajax异步请求删除默认地址，声明变量以便在js文件中使用
        var ajaxDelAddress = "<?php echo u('order/ajaxDelAddress');?>";
    </script>
    <script src="/c73/php_beijing/mall/Public/Home/js/jquery-1.10.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/c73/php_beijing/mall/Public/Home/layer/layer.js"></script>
    <?php foreach($headConf['js'] as $k=>$v){ ?>
    <script src="/c73/php_beijing/mall/Public/Home/js/<?php echo $v ?>.js" type="text/javascript" charset="utf-8"></script>
    <?php } ?>
</head>
<body>
<!--头部开始-->
<div id="top">
    <!--头部灰条就开始-->
    <div class="topbox">
        <div class="main">
            <div class="topleft fl">
                <a href="javascript:;">欢迎来到冰雨商城</a>

            </div>
            <div class="topright fr">
                <div class="login fl">
                    <?php if(!session('home.uid')){ ?>
                    <a href="<?php echo U('user/login');?>">登录</a>
                    <a href="<?php echo U('user/reg');?>">注册</a>
                    <?php }else{ ?>
                    <a href="<?php echo u('order/index');?>" style="color:#fff">欢迎您 <?php echo session('home.username');?></a>
                    <a href="<?php echo U('user/loginOut');?>">退出</a>
                    <?php }?>
                </div>
                <span class="fl">|</span>
                <div class="fcode fl">

                    <a href="<?php echo u('order/index');?>">我的订单</a>
                </div>
            </div>
        </div>
    </div>
    <!--头部灰条结束-->

    <!--logo区域开始-->
    <div class="logoRegion">
        <div class="main">
            <div class="logo">
                <a href="<?php echo U('home/index/index');?>"><img src="/c73/php_beijing/mall/Public/Home/images/360logo.png"/></a>
            </div>
            <div class="seachRegion">
                <div class="seach fl">
                    <form action="" method="post">
                        <input type="text" class="seachtxt fl" value="O2+车载空气净化" />
                        <input type="submit" class="btn" value="" />
                    </form>
                    <p class="searchkey">
                        <a href="">电竞配件低至5折</a>
                        <a href="">电竞配件低至5折</a>
                        <a href="">电竞配件低至5折</a>
                    </p>

                </div>
                <style>
                    .cart-tips ul {
                        padding:10px 20px;
                        overflow: hidden;
                    }
                    .cart-tips ul li{
                        overflow: hidden;
                        height:70px;
                        line-height:70px;
                        border-bottom: 1px solid #ccc;
                    }
                    .cart-tips ul li:last-child{
                        border:none;
                    }
                    .cart-tips  .pic {
                        float: left;
                    }
                    .cart-tips  .title a{
                        float: left;
                        color:#666;
                        width:142px;
                        overflow: hidden;
                        white-space:nowrap;
                        text-overflow:ellipsis;
                        margin-left: 10px;
                    }
                    .cart-tips  .price_num{
                        float: left;
                        margin-left: 30px;
                    }
                    .cart-tips  .del{
                        color:#666;
                        float: right;
                    }
                </style>
                <script>
//                    在载入页面的时候出发异步请求，获取购物车中的数量
                    $(function(){
                        $.post("<?php echo U('cart/ajaxGetCartNum');?>",{},function(res){
                            if(res){
                                $('#cart_num').text(res);
                            }
                        },'json');
                    })
                </script>
                <div class="topshopcart fr">
                    <a href="<?php echo U('cart/index');?>" class="header-cart"><i></i>我的购物车<span class="cart-size">(<span id="cart_num">0</span>)</span></a>
                    <div class="cart-tips" style="height:auto;">
                        <ul>
                            <li style="text-align:center;">购物车中还没有商品~ 去 <a href="#" style="color:red;">购物</a></li>
                        </ul>
                    </div>
                </div>
                <script>
                    $(function(){
                        $('.header-cart').mouseenter(function(){
                            $.post("<?php echo u('cart/ajaxGetCartData');?>",{},function(res){
                                if(res){
                                    var str= '';
                                    $.each(res,function(k,v){
                                        str +=
                                            '<li>' +
                                            '<a href="<?php echo u('cart/index');?>" class="pic"><img src="/c73/php_beijing/mall/'+v.pic+'" width="50"></a>' +
                                            '<p class="title"><a href="<?php echo u('cart/index');?>">'+v.name+'</a></p>' +
                                            '<p class="price_num">'+v.price+' X'+v.num+'</p>' +
                                            '<a href="javascript:;" class="delCartData" ucid="'+v.ucid+'" sid="'+k+'">X</a>' +
                                            '</li>';
                                    })
                                    str = '<ul>'+str+'</ul>';
                                    $('.header-cart').siblings('.cart-tips').find('ul').replaceWith(str);
                                }
                            },'json');
                        })
                        $(document).on('click','.delCartData',function(){
                            var _this= $(this);
                            $.post("<?php echo U('cart/ajaxDelCartData');?>",{ucid:$(this).attr('ucid'),sid:$(this).attr('sid')},function(res){
                                if(res){
                                    _this.parent().remove();
                                }
                            },'json');
                        })
                    })
                </script>
            </div>

        </div>
    </div>
    <!--logo区域结束-->
    <!--导航开始-->
    <div class="navbox">
        <div class="main">
            <h5 class="fl"><a href=""><i></i>全部智能酷品</a></h5>
            <ul class="menu fl">
                <?php if(is_array($data)): foreach($data as $k=>$v): ?><li class="menulist">
                        <a href="list.html"><?php echo ($v['cname']); ?></a>
                        <div class="menuHiden">

                            <ul class="product">
                                <?php if(is_array($randData)): foreach($randData as $k=>$v): ?><li>
                                        <a href=""><img width="120" src="/c73/php_beijing/mall/<?php echo ($v['pic']); ?>" /></a>
                                    </li><?php endforeach; endif; ?>
                            </ul>

                        </div>
                    </li><?php endforeach; endif; ?>
            </ul>

        </div>


        
</div>
<!--导航结束-->
<div class="clear"></div>

</div>
<!--头部结束-->
<!--中间开始-->
<div id="content">
	<div class="cont">
		<div class="main">
			<div class="content-left">
				<div class="box">
					<div class="zhezhao"></div>
					<div class="sekuai"></div>
					<div class="smallTu"></div>
					<a href="javascript:;" class="shang">&lt;</a>
					<div class="list1">
						<ul>
							<?php if(is_array($goodsData['medium_pic'])): $i = 0; $__LIST__ = $goodsData['medium_pic'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><img src="/c73/php_beijing/mall/<?php echo ($v); ?>" alt=""></li><?php endforeach; endif; else: echo "" ;endif; ?>
						</ul>
					</div>
					<a href="javascript:;" class="xia">&gt;</a>

					<div class="bgTu"></div>
					<div class="bgTuHide">
						<ul>
							<?php if(is_array($goodsData['big_pic'])): $i = 0; $__LIST__ = $goodsData['big_pic'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><img src="/c73/php_beijing/mall/<?php echo ($v); ?>" alt=""></li><?php endforeach; endif; else: echo "" ;endif; ?>
						</ul>

					</div>
				</div>
			</div>
			<div class="content-right">

				<div class="tit"><?php echo ($goodsData['gname']); ?></div>
				<div class="description">
					<?php if(is_array($attrData)): foreach($attrData as $k=>$v): echo ($v['gavalue']); ?>&nbsp;<?php endforeach; endif; ?>
				</div>
				<div class="pirve"><?php echo ($goodsData['shopprice']); ?></div>


				<?php if(is_array($specData)): foreach($specData as $k=>$v): ?><div class="category">
						<h4><?php echo ($k); ?></h4>
						<ul>
							<?php if(is_array($v)): foreach($v as $kk=>$vv): ?><li gaid="<?php echo ($vv['gaid']); ?>" specName="<?php echo ($k); ?>"><?php echo ($vv['gavalue']); ?></li><?php endforeach; endif; ?>
						</ul>
					</div><?php endforeach; endif; ?>
				<script>
					$(function(){
//					    当规格都被选中时，异步获取库存
					    $(".category li").click(function(){
//					        判断是否每个规格都被选中
							if($('.category .zhong').length != $('.category').length){
							    return false;
							}
					        var gid = <?php echo ($_GET['gid']); ?>;
					        var combine='';
					        $('.category .zhong').each(function(k,v){
					            combine+= $(this).attr('gaid')+',';
							});
					        $.post("<?php echo U('ajaxGetTotal');?>",{gid:gid,combine:combine},function(res){
								if(res){
//								    有库存
                                    $('.goodsTotal').html('库存为：'+res);
                                    $('.nobdr h6').addClass('allow').removeClass('disabled');
                                }else{
//								    没有库存
                                    $('.goodsTotal').html('库存为：0');
                                    $('.nobdr h6').addClass('disabled').removeClass('allow');
                                }
							},'json');

						})
					})
				</script>
				<div class="num">
					<h5>数量</h5>
					<a href="javascript:;" class="num_l">-</a>
					<input id="total" type="text" value="1" />
					<a href="javascript:;" class="num_r">+</a>
					<span class="goodsTotal" style="margin-left: 2em; line-height: 2em;">库存为：0</span>
				</div>
				<style>
					.allow{
						background: #fa5437;
					}
					.disabled{
						background: #ccc;
					}
				</style>
				<div class="nobdr">
					<h6 class="allow"><a href="javascript:;">加入购物车</a></h6>
				</div>
				<script>
					$(function(){
//					    点击加入购物车事件
					    $(".nobdr .allow").click(function(){
							if($(this).is('.disabled')){
                                return false;
							}
//					        判断是否每个规格都被选中
                            if($('.category .zhong').length != $('.category').length){
							    layer.msg('请选择规格');
							    return false;
							}
//							需要异步到后台的数据
							var data = {
                                gid:<?php echo ($_GET['gid']); ?>,
								num:$('#total').val(),
								options:{}
							}
							$('.category .zhong').each(function(){
								data['options'][$(this).attr('specName')] = $(this).text();
							});
							$.post("<?php echo u('ajaxAddToCart');?>",data,function(res){
								location.href="<?php echo u('Cart/index');?>";
							},'json');
						})
					})
				</script>
				<div class="houdun">
					<h3>保障</h3>
					<p><i class="o1"></i>360商城发货&售后</p>
					<p><i class="o2"></i>满99元包邮</p>
					<p><i class="o3"></i>7天无理由退货</p>
					<p><i class="o4"></i>15天免费换货</p>
				</div>
			</div>
		</div>
	</div>
	<div class="desc" id="xijie">
		<div class="desctab" >
			<div class="main">
				<ul>
					<li><a href="#xijie">产品详情</a><span>|</span></li>
					<li><a href="#guige">规格参数</a><span>|</span></li>
					<li><a href="#wenti">常见问题</a></li>
				</ul>
			</div>
		</div>
		<div class="con">
			<div class="con-pic">
				<?php echo ($goodsData['intro']); ?>
			</div>
		</div>
		<div class="con main" id="guige">
			<h1>产品参数</h1>
			<table cellpadding="0" cellspacing="0" border="1">
				<tbody>
				<tr>
					<td class="wd207" colspan="2">主体</td>
				</tr>
				<tr>
					<td class="wd207">品牌</td>
					<td><?php echo ($goodsData['bname']); ?></td>
				</tr>
				<tr>
					<td class="wd207" colspan="2">属性</td>
				</tr>
				<!--循环属性-->
				<?php if(is_array($attrData)): foreach($attrData as $k=>$v): ?><tr>
						<td class="wd207"><?php echo ($v['taname']); ?></td>
						<td>
							<?php echo ($v['gavalue']); ?>
						</td>
					</tr><?php endforeach; endif; ?>
				<tr>
					<td class="wd207" colspan="2">规格</td>
				</tr>
				<!--循环规格-->
				<?php if(is_array($specData)): foreach($specData as $k=>$v): ?><tr>
						<td class="wd207"><?php echo ($k); ?></td>
						<td>
							<?php if(is_array($v)): foreach($v as $kk=>$vv): echo ($vv['gavalue']); ?>&nbsp;<?php endforeach; endif; ?>

						</td>
					</tr><?php endforeach; endif; ?>
				</tbody>
			</table>
		</div>
		<div class="con main" id="wenti">
			<h2>常见问题</h2>
			<dl>
				<dt><i>1、</i><em></em>订单提交成功后还可以修改收货信息吗？</dt>
				<dd><u></u>订单付款之前，您可以进入“我的订单”，在订单详情页内修改收货信息。付款之后将不可修改收货信息。</dd>
			</dl>
			<dl>
				<dt><i>2、</i><em></em>订单提交成功后还可以修改收货信息吗？</dt>
				<dd><u></u>订单付款之前，您可以进入“我的订单”，在订单详情页内修改收货信息。付款之后将不可修改收货信息。</dd>
			</dl>
			<dl>
				<dt><i>3、</i><em></em>订单提交成功后还可以修改收货信息吗？</dt>
				<dd><u></u>订单付款之前，您可以进入“我的订单”，在订单详情页内修改收货信息。付款之后将不可修改收货信息。</dd>
			</dl>
			<dl>
				<dt><i>4、</i><em></em>订单提交成功后还可以修改收货信息吗？</dt>
				<dd><u></u>订单付款之前，您可以进入“我的订单”，在订单详情页内修改收货信息。付款之后将不可修改收货信息。</dd>
			</dl>
			<dl>
				<dt><i>5、</i><em></em>订单提交成功后还可以修改收货信息吗？</dt>
				<dd><u></u>订单付款之前，您可以进入“我的订单”，在订单详情页内修改收货信息。付款之后将不可修改收货信息。</dd>
			</dl>
			<dl>
				<dt><i>6、</i><em></em>订单提交成功后还可以修改收货信息吗？</dt>
				<dd><u></u>订单付款之前，您可以进入“我的订单”，在订单详情页内修改收货信息。付款之后将不可修改收货信息。</dd>
			</dl>
			<dl>
				<dt><i>7、</i><em></em>订单提交成功后还可以修改收货信息吗？</dt>
				<dd><u></u>订单付款之前，您可以进入“我的订单”，在订单详情页内修改收货信息。付款之后将不可修改收货信息。</dd>
			</dl>

		</div>
	</div>

</div>
</div>
<!--中间结束-->



        <!--尾部开始-->
        <div class="mod-footer">
            <div class="foot-bannerw">
                <div class="foot-banner clearfix">
                    <div class="banner-item">
                        <a href="#" target="_blank" data-monitor="home_foot_days7"><i class="icon1">7</i>7天无理由退货</a>
                    </div>
                    <div class="banner-item">
                        <a href="#" target="_blank" data-monitor="home_foot_days15"><i class="icon2">15</i>15天免费换货</a>
                    </div>
                    <div class="banner-item"><i class="icon3">包</i>满99元包邮</div>
                    <div class="banner-item">
                        <a href="#" target="_blank" data-monitor="home_foot_moblie"><i class="icon4">服</i>手机特色服务</a>
                    </div>
                </div>
            </div>
            <div class="foot-containerw">
                <div class="foot-container clearfix">
                    <dl class="foot-con"> <dt data-monitor="home_foot_freshman">帮助中心 </dt>
                        <dd data-monitor="home_help_freshman">
                            <a target="_blank" href="#" rel="nofollow">用户注册</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">用户登录与密码找回</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">购买指南</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">支付方式</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">配送与说明</a>
                        </dd>
                    </dl>
                    <dl class="foot-con"> <dt data-monitor="home_foot_help">售后服务 </dt>
                        <dd data-monitor="home_help_help">
                            <a target="_blank" href="#">7 日无理由退货</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">质量问题 15 日内换货</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">保修条款</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">服务流程</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">安迷之家</a>
                        </dd>
                    </dl>
                    <dl class="foot-con"> <dt data-monitor="home_foot_guide">特色服务 </dt>
                        <dd data-monitor="home_help_guide">
                            <a target="_blank" href="#" rel="nofollow">F码通道</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">免费试用</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">360 生态</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">一元夺宝</a>
                        </dd>
                    </dl>
                    <dl class="foot-con"> <dt data-monitor="home_foot_tuiguang">推广合作 </dt>
                        <dd data-monitor="home_help_try">
                            <a target="_blank" href="#" rel="nofollow">商品入驻</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">大客户采购</a>
                        </dd>
                    </dl>
                    <dl class="foot-con"> <dt data-monitor="home_foot_try">关注360商城 </dt>
                        <dd data-monitor="home_help_try">
                            <a target="_blank" href="#" rel="nofollow">360商城大事记</a>
                        </dd>
                    </dl>

                </div>
            </div>
            <div class="footer-copyright">冰雨商城 ©2016-2018 BYCMS工作室版权所有 京ICP备000001号-43</div>
        </div>
        <!--尾部结束-->

        <!--右边底部返回顶部-->
        <div class="slidebar" id="slidebar">
            <ul>
                <li class="topback">
                    <a href="javascript:;"></a>
                </li>
            </ul>
        </div>
        <!--右边底部返回顶部结束-->

</body>

</html>